import request from '@/utils/request'

const api_name = '/warehouse'

export default {
  getAllWarehouse(warehouseInfo) {
    return request({
      url: `${api_name}/allwarehouse`,
      method: 'post',
      data: warehouseInfo
    })
  },
  updateWarehouseStatus(warehouse) {
    return request({
      url: `${api_name}/updateStatus`,
      method: 'post',
      data: warehouse
    })
  },
  addNewWarehouse(newWarehouse) {
    return request({
      url: `${api_name}/addwarehouse`,
      method: 'get',
      data: newWarehouse
    })
  },
  getwarehouses() {
    return request({
      url: `${api_name}/warehouses`,
      method: 'post'
    })
  },
  getTotalCount(data){
    return request({
      url: `${api_name}/getTotalCount`,
      method: 'get',
      params: data
    })
  },
  getProductCount(data){
    return request({
      url: `${api_name}/getProductCount`,
      method: 'get',
      params: data
    })
  },
  getInandOutCount(data){
    return request({
      url: `${api_name}/getInandOutCount`,
      method: 'get',
      params: data
    })
  },
  getTotalCostByProduct(data){
    return request({
      url: `${api_name}/getTotalCostByProduct`,
      method: 'get',
      params: data
    })
  },
  getTotalCostByStock(data){
    return request({
      url: `${api_name}/getTotalCostByStock`,
      method: 'get',
      params: data
    })
  },
  getTotalQuantityByWarehouse(data){
    return request({
      url: `${api_name}/getTotalQuantityByWarehouse`,
      method: 'get',
      params: data
    })
  },
  getTotalQuantityByWarehouseAndDate(data){
    return request({
      url: `${api_name}/getTotalQuantityByWarehouseAndDate`,
      method: 'get',
      params: data
    })
  },
  getTotalCostByWarehouseAndDate(data){
    return request({
      url: `${api_name}/getTotalCostByWarehouseAndDate`,
      method: 'get',
      params: data
    })
  },
  getTotalCostByWarehouseAndDates(data){
    return request({
      url: `${api_name}/getTotalCostByWarehouseAndDates`,
      method: 'get',
      params: data
    })
  },
  getTotalRevenueByWarehouseAndDate(data){
    return request({
      url: `${api_name}/getTotalRevenueByWarehouseAndDate`,
      method: 'get',
      params: data
    })
  },
}
